<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Distributing Python Modules &mdash; Python v2.6.2 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.6.2',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v2.6.2 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v2.6.2 documentation" href="../index.html" />
    <link rel="next" title="1. An Introduction to Distutils" href="introduction.html" />
    <link rel="prev" title="Supporting Cyclic Garbage Collection" href="../c-api/gcsupport.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="1. An Introduction to Distutils"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../c-api/gcsupport.html" title="Supporting Cyclic Garbage Collection"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.6.2 documentation</a> &raquo;</li>
 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="distributing-python-modules">
<span id="distutils-index"></span><h1>Distributing Python Modules<a class="headerlink" href="#distributing-python-modules" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Authors:</th><td class="field-body">Greg Ward, Anthony Baxter</td>
</tr>
<tr class="field"><th class="field-name">Email:</th><td class="field-body"><a class="reference external" href="mailto:distutils-sig&#37;&#52;&#48;python&#46;org">distutils-sig<span>&#64;</span>python<span>&#46;</span>org</a></td>
</tr>
<tr class="field"><th class="field-name">Release:</th><td class="field-body">2.6</td>
</tr>
<tr class="field"><th class="field-name">Date:</th><td class="field-body">April 15, 2009</td>
</tr>
</tbody>
</table>
<p>This document describes the Python Distribution Utilities (&#8220;Distutils&#8221;) from
the module developer&#8217;s point of view, describing how to use the Distutils to
make Python modules and extensions easily available to a wider audience with
very little overhead for build/release/install mechanics.</p>
<ul>
<li class="toctree-l1"><a class="reference external" href="introduction.html">1. An Introduction to Distutils</a><ul>
<li class="toctree-l2"><a class="reference external" href="introduction.html#concepts-terminology">1.1. Concepts &amp; Terminology</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#a-simple-example">1.2. A Simple Example</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#general-python-terminology">1.3. General Python terminology</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#distutils-specific-terminology">1.4. Distutils-specific terminology</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="setupscript.html">2. Writing the Setup Script</a><ul>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#listing-whole-packages">2.1. Listing whole packages</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#listing-individual-modules">2.2. Listing individual modules</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#describing-extension-modules">2.3. Describing extension modules</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#relationships-between-distributions-and-packages">2.4. Relationships between Distributions and Packages</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#installing-scripts">2.5. Installing Scripts</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#installing-package-data">2.6. Installing Package Data</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#installing-additional-files">2.7. Installing Additional Files</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#additional-meta-data">2.8. Additional meta-data</a></li>
<li class="toctree-l2"><a class="reference external" href="setupscript.html#debugging-the-setup-script">2.9. Debugging the setup script</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="configfile.html">3. Writing the Setup Configuration File</a></li>
<li class="toctree-l1"><a class="reference external" href="sourcedist.html">4. Creating a Source Distribution</a><ul>
<li class="toctree-l2"><a class="reference external" href="sourcedist.html#specifying-the-files-to-distribute">4.1. Specifying the files to distribute</a></li>
<li class="toctree-l2"><a class="reference external" href="sourcedist.html#manifest-related-options">4.2. Manifest-related options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="builtdist.html">5. Creating Built Distributions</a><ul>
<li class="toctree-l2"><a class="reference external" href="builtdist.html#creating-dumb-built-distributions">5.1. Creating dumb built distributions</a></li>
<li class="toctree-l2"><a class="reference external" href="builtdist.html#creating-rpm-packages">5.2. Creating RPM packages</a></li>
<li class="toctree-l2"><a class="reference external" href="builtdist.html#creating-windows-installers">5.3. Creating Windows Installers</a></li>
<li class="toctree-l2"><a class="reference external" href="builtdist.html#cross-compiling-on-windows">5.4. Cross-compiling on Windows</a></li>
<li class="toctree-l2"><a class="reference external" href="builtdist.html#vista-user-access-control-uac">5.5. Vista User Access Control (UAC)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="packageindex.html">6. Registering with the Package Index</a><ul>
<li class="toctree-l2"><a class="reference external" href="packageindex.html#the-pypirc-file">6.1. The .pypirc file</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="uploading.html">7. Uploading Packages to the Package Index</a></li>
<li class="toctree-l1"><a class="reference external" href="examples.html">8. Examples</a><ul>
<li class="toctree-l2"><a class="reference external" href="examples.html#pure-python-distribution-by-module">8.1. Pure Python distribution (by module)</a></li>
<li class="toctree-l2"><a class="reference external" href="examples.html#pure-python-distribution-by-package">8.2. Pure Python distribution (by package)</a></li>
<li class="toctree-l2"><a class="reference external" href="examples.html#single-extension-module">8.3. Single extension module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="extending.html">9. Extending Distutils</a><ul>
<li class="toctree-l2"><a class="reference external" href="extending.html#integrating-new-commands">9.1. Integrating new commands</a></li>
<li class="toctree-l2"><a class="reference external" href="extending.html#adding-new-distribution-types">9.2. Adding new distribution types</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="commandref.html">10. Command Reference</a><ul>
<li class="toctree-l2"><a class="reference external" href="commandref.html#installing-modules-the-install-command-family">10.1. Installing modules: the <strong>install</strong> command family</a></li>
<li class="toctree-l2"><a class="reference external" href="commandref.html#creating-a-source-distribution-the-sdist-command">10.2. Creating a source distribution: the <strong>sdist</strong> command</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="apiref.html">11. API Reference</a><ul>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.core">11.1. <tt class="docutils literal"><span class="pre">distutils.core</span></tt> &#8212; Core Distutils functionality</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.ccompiler">11.2. <tt class="docutils literal"><span class="pre">distutils.ccompiler</span></tt> &#8212; CCompiler base class</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.unixccompiler">11.3. <tt class="docutils literal"><span class="pre">distutils.unixccompiler</span></tt> &#8212; Unix C Compiler</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.msvccompiler">11.4. <tt class="docutils literal"><span class="pre">distutils.msvccompiler</span></tt> &#8212; Microsoft Compiler</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.bcppcompiler">11.5. <tt class="docutils literal"><span class="pre">distutils.bcppcompiler</span></tt> &#8212; Borland Compiler</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.cygwinccompiler">11.6. <tt class="docutils literal"><span class="pre">distutils.cygwincompiler</span></tt> &#8212; Cygwin Compiler</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.emxccompiler">11.7. <tt class="docutils literal"><span class="pre">distutils.emxccompiler</span></tt> &#8212; OS/2 EMX Compiler</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.mwerkscompiler">11.8. <tt class="docutils literal"><span class="pre">distutils.mwerkscompiler</span></tt> &#8212; Metrowerks CodeWarrior support</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.archive_util">11.9. <tt class="docutils literal"><span class="pre">distutils.archive_util</span></tt> &#8212;  Archiving utilities</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.dep_util">11.10. <tt class="docutils literal"><span class="pre">distutils.dep_util</span></tt> &#8212; Dependency checking</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.dir_util">11.11. <tt class="docutils literal"><span class="pre">distutils.dir_util</span></tt> &#8212; Directory tree operations</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.file_util">11.12. <tt class="docutils literal"><span class="pre">distutils.file_util</span></tt> &#8212; Single file operations</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.util">11.13. <tt class="docutils literal"><span class="pre">distutils.util</span></tt> &#8212; Miscellaneous other utility functions</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.dist">11.14. <tt class="docutils literal"><span class="pre">distutils.dist</span></tt> &#8212; The Distribution class</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.extension">11.15. <tt class="docutils literal"><span class="pre">distutils.extension</span></tt> &#8212; The Extension class</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.debug">11.16. <tt class="docutils literal"><span class="pre">distutils.debug</span></tt> &#8212; Distutils debug mode</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.errors">11.17. <tt class="docutils literal"><span class="pre">distutils.errors</span></tt> &#8212; Distutils exceptions</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.fancy_getopt">11.18. <tt class="docutils literal"><span class="pre">distutils.fancy_getopt</span></tt> &#8212; Wrapper around the standard getopt module</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.filelist">11.19. <tt class="docutils literal"><span class="pre">distutils.filelist</span></tt> &#8212; The FileList class</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.log">11.20. <tt class="docutils literal"><span class="pre">distutils.log</span></tt> &#8212; Simple PEP 282-style logging</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.spawn">11.21. <tt class="docutils literal"><span class="pre">distutils.spawn</span></tt> &#8212; Spawn a sub-process</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.sysconfig">11.22. <tt class="docutils literal"><span class="pre">distutils.sysconfig</span></tt> &#8212; System configuration information</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.text_file">11.23. <tt class="docutils literal"><span class="pre">distutils.text_file</span></tt> &#8212; The TextFile class</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.version">11.24. <tt class="docutils literal"><span class="pre">distutils.version</span></tt> &#8212; Version number classes</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.cmd">11.25. <tt class="docutils literal"><span class="pre">distutils.cmd</span></tt> &#8212; Abstract base class for Distutils commands</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command">11.26. <tt class="docutils literal"><span class="pre">distutils.command</span></tt> &#8212; Individual Distutils commands</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist">11.27. <tt class="docutils literal"><span class="pre">distutils.command.bdist</span></tt> &#8212; Build a binary installer</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist_packager">11.28. <tt class="docutils literal"><span class="pre">distutils.command.bdist_packager</span></tt> &#8212; Abstract base class for packagers</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist_dumb">11.29. <tt class="docutils literal"><span class="pre">distutils.command.bdist_dumb</span></tt> &#8212; Build a &#8220;dumb&#8221; installer</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist_msi">11.30. <tt class="docutils literal"><span class="pre">distutils.command.bdist_msi</span></tt> &#8212; Build a Microsoft Installer binary package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist_rpm">11.31. <tt class="docutils literal"><span class="pre">distutils.command.bdist_rpm</span></tt> &#8212; Build a binary distribution as a Redhat RPM and SRPM</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.bdist_wininst">11.32. <tt class="docutils literal"><span class="pre">distutils.command.bdist_wininst</span></tt> &#8212; Build a Windows installer</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.sdist">11.33. <tt class="docutils literal"><span class="pre">distutils.command.sdist</span></tt> &#8212; Build a source distribution</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.build">11.34. <tt class="docutils literal"><span class="pre">distutils.command.build</span></tt> &#8212; Build all files of a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.build_clib">11.35. <tt class="docutils literal"><span class="pre">distutils.command.build_clib</span></tt> &#8212; Build any C libraries in a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.build_ext">11.36. <tt class="docutils literal"><span class="pre">distutils.command.build_ext</span></tt> &#8212; Build any extensions in a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.build_py">11.37. <tt class="docutils literal"><span class="pre">distutils.command.build_py</span></tt> &#8212; Build the .py/.pyc files of a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.build_scripts">11.38. <tt class="docutils literal"><span class="pre">distutils.command.build_scripts</span></tt> &#8212; Build the scripts of a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.clean">11.39. <tt class="docutils literal"><span class="pre">distutils.command.clean</span></tt> &#8212; Clean a package build area</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.config">11.40. <tt class="docutils literal"><span class="pre">distutils.command.config</span></tt> &#8212; Perform package configuration</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.install">11.41. <tt class="docutils literal"><span class="pre">distutils.command.install</span></tt> &#8212; Install a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.install_data">11.42. <tt class="docutils literal"><span class="pre">distutils.command.install_data</span></tt> &#8212; Install data files from a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.install_headers">11.43. <tt class="docutils literal"><span class="pre">distutils.command.install_headers</span></tt> &#8212; Install C/C++ header files from a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.install_lib">11.44. <tt class="docutils literal"><span class="pre">distutils.command.install_lib</span></tt> &#8212; Install library files from a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.install_scripts">11.45. <tt class="docutils literal"><span class="pre">distutils.command.install_scripts</span></tt> &#8212; Install script files from a package</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#module-distutils.command.register">11.46. <tt class="docutils literal"><span class="pre">distutils.command.register</span></tt> &#8212; Register a module with the Python Package Index</a></li>
<li class="toctree-l2"><a class="reference external" href="apiref.html#creating-a-new-distutils-command">11.47. Creating a new Distutils command</a></li>
</ul>
</li>
</ul>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h4>Previous topic</h4>
            <p class="topless"><a href="../c-api/gcsupport.html"
                                  title="previous chapter">Supporting Cyclic Garbage Collection</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="introduction.html"
                                  title="next chapter">1. An Introduction to Distutils</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/distutils/index.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="introduction.html" title="1. An Introduction to Distutils"
             >next</a> |</li>
        <li class="right" >
          <a href="../c-api/gcsupport.html" title="Supporting Cyclic Garbage Collection"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.6.2 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    <div class="footer">
      &copy; <a href="../copyright.html">Copyright</a> 1990-2009, Python Software Foundation.
      Last updated on Apr 15, 2009.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
    </div>
  </body>
</html>